package com.sc.nft.controller;

import com.sc.nft.entity.vo.OfficialWebsiteArticleWebVO;
import com.sc.nft.service.OfficialWebsiteArticleService;
import com.sc.nft.sup.PageRequest;
import com.sc.nft.sup.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 官网文章(OfficialWebsiteArticle)表控制层
 *
 * @author wwc
 * @since 2023-08-09 17:37:15
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("officialWebsiteArticle")
@Api(tags = "官网文章")
public class OfficialWebsiteArticleController {

    /**
     * 服务对象
     */
    private final OfficialWebsiteArticleService officialWebsiteArticleService;

    @PostMapping(value = "/page", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "获取分页数据", notes = "获取分页数据", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    public PageResult<OfficialWebsiteArticleWebVO> page(@RequestBody PageRequest pageRequest) {
        return PageResult.success(officialWebsiteArticleService.pageWeb(pageRequest));
    }

}
